<template>
  <div id="app">
    <router-view/>
    <footer v-if="!$route.path.includes('detail')">
      <tabbar></tabbar>
    </footer>
  </div>
</template>

<script>
import tabbar from '@/components/Tabbar'
import Vue from 'vue'
import moment from 'moment'

Vue.filter('actorsFilter', (actors) => {
  if (actors === undefined) return '暂无主演'
  // TODO: 将一个数组转化成了字符串
  return actors.map(actor => actor.name).join(' ')
})
Vue.filter('dateFilter', (date) => {
  return moment(date * 1000).format('YYYY-MM-DD')
})
Vue.filter('dateFilter2', (data) => {
  moment.locale('zh-cn')
  return moment(data * 1000).format('dddd MMMDo')
}
)
export default {
  components: {
    tabbar
  },
  data () {
    return {}
  }
}
</script>

<style lang="scss">
* {
  margin: 0;
  padding: 0;
  touch-action: manipulation; /* TODO: 禁用双击缩放功能 */
}

body {
  background-color: #f4f4f4;
}

#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  //text-align: center;
  color: #2c3e50;
}

li {
  list-style: none;
}

footer {
  margin-top: 13vw;
}
</style>
